{template header}
<style>
    .help-block{
        color: red;
        font-style: italic;
    }
</style>
<script src="static/bootstrap/js/utils.js"></script>
<link rel="stylesheet" href="static/calendar/js/calendar.css" />
<script type="text/javascript" charset="utf-8" src="static/calendar/calendar.php"></script>
<form class="form-horizontal" method="post" enctype="multipart/form-data" onsubmit="return checkInfo();">
    <fieldset>
        <div id="legend" class="">
            <legend class="">马甲号</legend>
        </div>
        <div class="control-group">
            <label class="control-label">头像</label>

            <!-- File Upload -->
            <div class="controls">
                <input class="input-file" name="header" type="file">

            </div>
        </div>
        {if $user['header']}
        <div class="control-group">

            <!-- Text input-->
            <label class="control-label" for="input">原头像</label>
            <div class="controls">
                <img src="{$user['header']}"/>
            </div>
        </div>


        {/if}
        <div class="control-group">

            <!-- Text input-->
            <label class="control-label" for="input01">昵称</label>
            <div class="controls">
                <input type="text" name="nickname" {if $user['nickname']} disabled{/if} value="{$user['nickname']}" placeholder="请输入昵称" class="input-xlarge">
                <p class="help-block"></p>
            </div>
        </div>

        <div class="control-group">

            <!-- Text input-->
            <label class="control-label" for="input02">身高</label>
            <div class="controls">
                <input type="text" name="height" value="{if $user['height']}$user['height']{else}175{/if}" placeholder="请输入身高" class="input-xlarge">CM
            </div>
        </div>

        <div class="control-group">

            <!-- Text input-->
            <label class="control-label" for="input03">体重</label>
            <div class="controls">
                <input type="text" name="weight" value="{if $user['weight']}$user['weight']{else}65{/if}" placeholder="请输入体重" class="input-xlarge">KG
            </div>
        </div>
        <div class="control-group">

            <!-- Text input-->
            <label class="control-label" for="input04">手机号</label>
            <div class="controls">
                <input type="text" name="phone" {if $user['phone']} disabled{/if} value="{$user['phone']}" placeholder="请输入手机号" class="input-xlarge">
                <p class="help-block"></p>
            </div>
        </div>
        <div class="control-group">

            <!-- Text input-->
            <label class="control-label" for="input05">密码</label>
            <div class="controls">
                <input type="password" name="pwd" value="{$user['pwd']}" placeholder="请输入密码" class="input-xlarge">
                <p class="help-block"></p>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputaddtime">出生年月：</label>
            <div class="controls">
                <input type="text" name="birthday" readonly="readonly" id="add_time_id" value="{if $user['birthday']}$user['birthday']{else}1997-1-2{/if}">
                <input name="add_time_btn" type="button" id="add_time_btn" onclick="return showCalendar('add_time_id', '%Y-%m-%d', false, false, 'add_time_btn');" value="选择" class="button" id="add_time_id"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="sign">个性签名：</label>
            <div class="controls">
                <textarea name="signature" placeholder="请输入内容" class="input-xlarge">{if $user['signature']}{$user['signature']}{else}跑步是一种运动，更是一种生活方式{/if}</textarea>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">性别</label>
            <div class="controls">

                <!-- Inline Radios -->
                <label class="radio inline">
                    <input type="radio" value="1" checked {if $user['gender'] == 1}checked="checked"{/if} name="gender">
                    男
                </label>
                <label class="radio inline">
                    <input type="radio" value="2" {if $user['gender'] == 2}checked="checked"{/if} name="gender">
                    女
                </label>
            </div>
        </div>
        <div class="control-group">

            <!-- Button -->
            <div class="controls">
                <input type="submit" class="btn btn-info"/>
            </div>
        </div>
    </fieldset>
</form>
<script>
    var nickname = $(":input[name='nickname']");
    var phone = $(":input[name='phone']");
    var pwd = $(":input[name='pwd']");
    nickname.focus(function(){
        $(this).next('p').html('');
    });
    phone.focus(function(){
        $(this).next('p').html('');
    });
    pwd.focus(function(){
        $(this).next('p').html('');
    });
    function checkInfo(){

        if(nickname.val().length == 0){
            nickname.next('p').html("*昵称不能为空！");
            return false;
        }
        if(phone.val().length == 0){
            phone.next('p').html("*手机号不能为空！");
            return false;
        }
        if(!Utils.isInt(phone.val())){
            phone.next('p').html("*手机号不正确！");
            return false;
        }
        if(pwd.val().length == 0){
            pwd.next('p').html("*密码不能为空！");
            return false;
        }
    }
</script>
{template footer}